import pytest
from core.database.models import Playlist, Song

def test_playlist_creation():
    playlist = Playlist(name="Test Playlist")
    assert playlist.name == "Test Playlist"
    assert playlist.songs == []

def test_song_duration_validation():
    with pytest.raises(ValueError):
        Song(title="Invalid", duration=-10)